{#
    Builds the header for the release dashboard
    * `title` A string
    * `description` A string
    * `tab` A string with one of the following values
        * `recent`
        * `stars`
        * `recent-failures`
        * `failures`
        * `activity`
        * `queue`
        * `owner` A string, used for the owners page
#}
{% macro header(title, description, tab, owner) %}
    <div class="docsrs-package-container">
        <div class="container">
            <div class="description-container">
                <h1 id="crate-title">{{ title }}</h1>
                <div class="description">{{ description }}</div>

                {# This does double-duty as the search, so hide all tabs when we're searching something #}
                <div class="pure-menu pure-menu-horizontal">
                    <ul class="pure-menu-list">
                        <li class="pure-menu-item">
                            <a href="/releases" class="pure-menu-link{% if *tab == "recent" %} pure-menu-active{% endif %}">
                                {{ crate::icons::IconLeaf.render_solid(false, false, "") }}
                                <span class="title">Recent</span>
                            </a>
                        </li>

                        <li class="pure-menu-item">
                            <a href="/releases/stars" class="pure-menu-link{% if *tab == "stars" %} pure-menu-active{% endif %}">
                                {{ crate::icons::IconStar.render_solid(false, false, "") }}
                                <span class="title">Stars</span>
                            </a>
                        </li>

                        <li class="pure-menu-item">
                            <a href="/releases/recent-failures"
                                class="pure-menu-link{% if *tab == "recent-failures" %} pure-menu-active{% endif %}">
                                {{ crate::icons::IconTriangleExclamation.render_solid(false, false, "") }}
                                <span class="title">Recent Failures</span>
                            </a>
                        </li>

                        <li class="pure-menu-item">
                            <a href="/releases/failures"
                                class="pure-menu-link{% if *tab == "failures" %} pure-menu-active{% endif %}">
                                {{ crate::icons::IconStar.render_regular(false, false, "") }}
                                <span class="title">Failures By Stars</span>
                            </a>
                        </li>

                        <li class="pure-menu-item">
                            <a href="/releases/activity"
                                class="pure-menu-link{% if *tab == "activity" %} pure-menu-active{% endif %}">
                                {{ crate::icons::IconChartLine.render_solid(false, false, "") }}
                                <span class="title">Activity</span>
                            </a>
                        </li>

                        <li class="pure-menu-item">
                            <a href="/releases/queue" class="pure-menu-link{% if *tab == "queue" %} pure-menu-active{% endif %}">
                                {{ crate::icons::IconList.render_solid(false, false, "") }}
                                <span class="title">Queue</span>
                            </a>
                        </li>

                        {%- if !owner.is_empty() -%}
                            <li class="pure-menu-item">
                                <a href="#" class="pure-menu-link{% if *tab == "owner" %} pure-menu-active{% endif %}">
                                    {{ crate::icons::IconUser.render_solid(false, false, "") }}
                                    <span class="title">{{ owner }}</span>
                                </a>
                            </li>
                        {%- endif -%}
                    </ul>
                </div>
            </div>
        </div>
    </div>
{% endmacro header %}

{% macro search_header(title) %}
    <div class="docsrs-package-container">
        <div class="container">
            <div class="description-container">
                <h1 id="crate-title">{{ title }}</h1>
            </div>
        </div>
    </div>
{% endmacro search_header %}
